package com.taptech.doufu.ext

import android.widget.Toast
import com.taptech.doufu.app.WeMediaApplication
import com.taptech.doufu.net.retrofit.api.BaseSubscriber
import rx.Observable
import rx.schedulers.Schedulers

/**
 * Observable执行扩展
 */
fun <T> Observable<T>.execute(subscriber: BaseSubscriber<T>){
        this.subscribeOn(Schedulers.io())
                .observeOn(AndroidScheduler.mainThread())
                .subscribe(subscriber)
}


fun appToast(content: String) {
        Toast.makeText(WeMediaApplication.applicationContext, content, Toast.LENGTH_SHORT).show()
}
